package com.line.api;

import com.line.model.pojo.GenerateTablePojo;
import com.line.service.TableService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/table")
@Api(tags = "实体模块")
public class TableController {

	@Autowired
	private TableService tableService;

	@PostMapping("/generate")
	@ApiOperation(value = "生成实体库", notes = "通过调用数据库，生成JPA实体库")
	public Map<String, String> generate(GenerateTablePojo pojo) throws Exception {
		return tableService.generateEntity(pojo);
	}
}
